package triannon.client.selection;

import java.util.ArrayList;

import triannon.client.sprites.SpriteList;

public class Selection {
	private static ArrayList<SelectionListener> listeners = new ArrayList<SelectionListener>();
	private static SpriteList selectedSprites = new SpriteList();

	public enum SelectedObject {
		Building, Unit, Enemy
	}

	public static void fireSelectionChanged(SelectionEvent evt) {
		selectedSprites = evt.getSelectedSprites();
		for (SelectionListener listener : listeners) {
			listener.selectionChanged(evt);
		}
	}

	public static SpriteList getSelectedSprite() {
		return selectedSprites;
	}

	public static void addSelectionListener(SelectionListener listener) {
		listeners.add(listener);
	}

	public static void removeSelectionListener(SelectionListener listener) {
		listeners.remove(listener);
	}
}
